import { GroupData } from "babylon-lib/data/base-data";
import { Vector3Data } from "babylon-lib/data/datas/vector3-data";
import { BooleanData } from 'babylon-lib/data/datas/boolean-data';
import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
import { Sound } from "@babylonjs/core/Audio/sound";
import { Calculation } from "babylon-lib/tool/calculation";
import { StringData } from 'babylon-lib/data/datas/string-data';
import { RawAssetsName } from "../raw-assets-info";
import { NumberData } from 'babylon-lib/data/datas/number-data';


/**
 * 数据：
 * rootData:{
 *      isProduction:boolean data,
 *      cameraData:{
 *          cameraPosition:Vector3 data, 
 *          cameraTarget:Vector3 data, 
 *      },
 * };
 */


const rootData = new GroupData();

const isProduction = new BooleanData(true);

const cameraData = new GroupData();
const cameraPosition = new Vector3Data(Calculation.vectorZ(0, 0, 300, true));
const cameraTarget = new Vector3Data(Calculation.vectorZ(0, -10, 300, true));
cameraData.add(cameraPosition, cameraTarget);

const controlPanelDisplay = new BooleanData(false);
const failedCount = new NumberData(10);
const gameOn = new BooleanData(false);
const taskState = {
    interrupt: '中断',
    failed: '失败',
    success: '完成',
};
const taskStatus = new StringData(taskState.interrupt);
const windStrength = new NumberData(0);
const fireNumber = new NumberData(0);
const gameTime = new NumberData(0);
const reloading = new BooleanData(false);
const coordinateX = new NumberData(0);
const coordinateZ = new NumberData(0);
const distance = new NumberData(0);
const offsetX = new NumberData(0);
const offsetZ = new NumberData(0);
const fireButtonDisplay = new BooleanData(true);

const enemyScore = new NumberData(0);

rootData.add(
    cameraData, controlPanelDisplay, failedCount, gameOn, taskStatus, windStrength, fireNumber, gameTime, reloading,
    coordinateX, coordinateZ, distance, offsetX, offsetZ, fireButtonDisplay, enemyScore,
);

const orders = {
    scene: 'scene',
    sceneFront: 'sceneFront',
    sceneUiBack: 'sceneUiBack',
    sceneUi: 'sceneUi',
    sceneUiFront: 'sceneUiFront',
    uiBack: 'uiBack',
    ui: 'ui',
    uiFront: 'uiFront',
};

const animations: { all?: AnimationGroup } = {};


export {
    rootData, isProduction, controlPanelDisplay,
    cameraData, cameraPosition, cameraTarget,
    orders, animations,
    failedCount, gameOn, taskState, taskStatus, windStrength, fireNumber, gameTime, reloading,
    coordinateX, coordinateZ, distance, offsetX, offsetZ, fireButtonDisplay, enemyScore,
};